package com.yun.blog.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yun.blog.bean.Category;
import com.yun.blog.dao.CategoryMapper;
import com.yun.blog.service.CategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CategoryServiceImpl
        extends ServiceImpl<CategoryMapper, Category>
        implements CategoryService {

    @Resource
    CategoryMapper categoryMapper;

    @Override
    public Category getByCategoryName(String categoryName) {
        return categoryMapper.getByCategoryName(categoryName);
    }

    @Override
    public Category getByCategoryId(Integer categoryId) {
        return categoryMapper.getByCategoryId(categoryId);
    }

    @Override
    public List<Category> getByIsUse(Boolean isUse) {
        return categoryMapper.getByIsUse(isUse);
    }

    @Override
    public <P extends IPage<Category>> P customPage(P page, String searchText) {
        return categoryMapper.customPage(page, searchText);
    }
}
